/*
 * AttachWindow.h
 *
 *  Created on: 2024年9月11日
 *      Author: nwz
 */

#ifndef CODE_ATTACHWINDOW_H_
#define CODE_ATTACHWINDOW_H_

class AttachWindow: public wxDialog {
public:
	AttachWindow();
	virtual ~AttachWindow();

	void init(wxWindow *window, int x, int y, int width, int height);
	void reset();

	HWND getSelectedHWND();

private:
	HWND process_hwnd;
	wxDataViewListCtrl *data_grid;
	struct process_info {
		DWORD pid;
		HWND hwnd;
		std::string title;
		std::string process_path;
	};
	std::vector<struct process_info> process_infos;
	static BOOL enumWindowCallback(HWND hwnd, LPARAM param);
	void onClose(wxCloseEvent &event);
	void onGridDoubleClick(wxMouseEvent&);
};

#endif /* CODE_ATTACHWINDOW_H_ */
